<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
    <title>Search{% if query %} Results{% endif %}</title>
</head>
<body>
  <h1>Search</h1>
  <form action="." method="GET">
    <label for="q">Search: </label>
    <input type="text" name="q" value="{{ query|escape }}">
    <input type="submit" value="Search">
  </form>
	
  {% if query %}
    <h2>Results for "{{ query|escape }}":</h2>

    {% if results %}
      <ul>
      {% for result in results %}
        -----------------------------------------------------------------------------<br>{{ result.department|escape }} {{ result.class_field|escape }} - {{ result.name|escape }} - {{result.section}}<br><b>Lecture Time:</b> {{result.schedule|escape}} <br>{{ result.description|escape }}<br>-----------------------------------------------------------------------------<p>
      {% endfor %}
      </ul>
    {% else %}
      <p>No classes found</p>
    {% endif %}
  {% else %}
	<p>Please enter a non blank query!<p>
  {% endif %}
  
</body>
</html>
